import java.util.PriorityQueue;

/**
 * Created with IntelliJ IDEA.
 * Description:
 * User: 86183
 * Date: 2024-02-06
 * Time: 16:04
 */
public class Test {
    public static int[] smallestK(int[] arr, int k) {
        PriorityQueue<Integer> priorityQueue=new PriorityQueue<>();
        for (int i = 0; i < arr.length; i++) {
            priorityQueue.offer(arr[i]);
        }
        int[] tmp=new int[k];
        for (int i = 0; i < k; i++) {
            tmp[i]=priorityQueue.poll();

        }
        return tmp;


    }

    public static void main(String[] args) {

    }
}
